<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>canvas basic</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }
        canvas {
            background-color: rgba(223, 215, 215, 0.3);
        }
    </style>
</head>
<body>
    <canvas width="500" height="500"></canvas>

    <script>
        let canvas = document.querySelector('canvas')
        const ctx = canvas.getContext('2d')
        ctx.rect(200, 200, 100, 100)
        ctx.fillStyle = 'red'
        ctx.fill()
    </script>
</body>
</html>